﻿@model IEnumerable<Web.Areas.Admin.Models.ModuleItem>

@{
    ViewBag.Title = "权限设置";
    Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
}
@section header{}
<div class="nav">当前位置 :-> 角色设置 :-> 权限设置</div>

@using (Html.BeginForm())
{
    <input type="hidden" name="RoleID" value="@ViewBag.RoleID" />
<table width="100%">
<tr><th>模块</th><th>查看</th><th>添加</th><th>编辑</th><th>删除</th><th>权限</th></tr>
@foreach (var item in Model)
{
    <tr><td><strong>@item.ModuleName</strong></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
    foreach (var child in item.ChildModules)
    {
        <tr>
            <td>--@child.ModuleName</td>
            <td><center><input type="checkbox" name="@child.ModuleID" value='view' @Html.CheckPermission(child.RoleID, child.ModuleID, "view") /></center></td>
            <td><center><input type="checkbox" name="@child.ModuleID" value='add' @Html.CheckPermission(child.RoleID, child.ModuleID, "add") /></center></td>
            <td><center><input type="checkbox" name="@child.ModuleID" value='edit' @Html.CheckPermission(child.RoleID, child.ModuleID, "edit") /></center></td>
            <td><center><input type="checkbox" name="@child.ModuleID" value='del' @Html.CheckPermission(child.RoleID, child.ModuleID, "del") /></center></td>
            <td><center><input type="checkbox" name="@child.ModuleID" value='permission' @Html.CheckPermission(child.RoleID, child.ModuleID, "permission") /></center></td>
        </tr>
    }
}
</table>
    <p>
            <input type="submit" value="设置" />
    </p>
}